/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-10 08:35:30
 * Copyright (c) 2015- joysuch-版权所有
 */

package com.joysuch.wwyt.bp.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "wwyt_bp_system_video")
@SQLDelete(sql = "update wwyt_bp_system_video set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_system_video set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpSystemVideo implements java.io.Serializable {

    // columns START
    // ID
    private Long id;
    // 视频设备名称
    private String name;
    //设备类型
    private String deviceType;
    //设备种类
    private String deviceClass;
    // 品牌
    private String brand;
    // 所在风险区域
    private String evaluation;
    // 实时视频流地址预览
    private String realTimeSite;
    // 历史视频流地址预览
    private String historySite;
    // 地址日期格式
    private String dateFormat;
    // 地址时间格式
    private String timeFormat;
    // 画区域
    private String region;
    // 删除标记
    private String deleteFlag;
    // 租户ID
    private Long tenentId;
    // 组织机构代码
    private String orgCode;
    // columns END
    private String account;
    private String password;
    private String ip;
    private Integer port;
    private String channelNo;
    // 视频编码类型
    private String codeType;
    //增加参数字段protocol ,1表示TCP，2表示UDP
    private String protocol;


    @Column(name = "ACCOUNT", length = 50)
    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    @Column(name = "PASSWORD", length = 50)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name = "IP", length = 255)
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Column(name = "PORT")
    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    @Column(name = "CHANNEL_NO", length = 15)
    public String getChannelNo() {
        return channelNo;
    }

    public void setChannelNo(String channelNo) {
        this.channelNo = channelNo;
    }

    @Column(name = "DEVICE_TYPE", length = 15)
    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    @Column(name = "DEVICE_CLASS", length = 15)
    public String getDeviceClass() {
        return deviceClass;
    }

    public void setDeviceClass(String deviceClass) {
        this.deviceClass = deviceClass;
    }

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "NAME", length = 20)
    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }


    @Column(name = "BRAND", length = 20)
    public String getBrand() {
        return this.brand;
    }

    public void setBrand(String value) {
        this.brand = value;
    }

    @Column(name = "EVALUATION", length = 200)
    public String getEvaluation() {
        return this.evaluation;
    }

    public void setEvaluation(String value) {
        this.evaluation = value;
    }

    @Column(name = "REAL_TIME_SITE", length = 500)
    public String getRealTimeSite() {
        return this.realTimeSite;
    }

    public void setRealTimeSite(String value) {
        this.realTimeSite = value;
    }

    @Column(name = "HISTORY_SITE", length = 500)
    public String getHistorySite() {
        return this.historySite;
    }

    public void setHistorySite(String value) {
        this.historySite = value;
    }

    @Column(name = "DATE_FORMAT", length = 100)
    public String getDateFormat() {
        return this.dateFormat;
    }

    public void setDateFormat(String value) {
        this.dateFormat = value;
    }

    @Column(name = "TIME_FORMAT", length = 100)
    public String getTimeFormat() {
        return this.timeFormat;
    }

    public void setTimeFormat(String value) {
        this.timeFormat = value;
    }

    @Column(name = "REGION", length = 500)
    public String getRegion() {
        return this.region;
    }

    public void setRegion(String value) {
        this.region = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }

    @Column(name = "CODE_TYPE", length = 32)
    public String getCodeType() {
        return codeType;
    }

    public void setCodeType(String codeType) {
        this.codeType = codeType;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    @Override
    public String toString() {
        return "BpSystemVideo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", deviceType='" + deviceType + '\'' +
                ", deviceClass='" + deviceClass + '\'' +
                ", brand='" + brand + '\'' +
                ", evaluation='" + evaluation + '\'' +
                ", realTimeSite='" + realTimeSite + '\'' +
                ", historySite='" + historySite + '\'' +
                ", dateFormat='" + dateFormat + '\'' +
                ", timeFormat='" + timeFormat + '\'' +
                ", region='" + region + '\'' +
                ", deleteFlag='" + deleteFlag + '\'' +
                ", tenentId=" + tenentId +
                ", orgCode='" + orgCode + '\'' +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                ", ip='" + ip + '\'' +
                ", port=" + port +
                ", channelNo='" + channelNo + '\'' +
                ", codeType='" + codeType + '\'' +
                '}';
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpSystemVideo == false)
            return false;
        if (this == obj)
            return true;
        BpSystemVideo other = (BpSystemVideo) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
